package com.vitabuybuy.tv.ui.auth

import android.os.Bundle
import com.vitabuybuy.tv.R
import com.vitabuybuy.tv.databinding.ActivityLoginBinding
import com.library.common.base.BaseActivity
import com.vitabuybuy.tv.ui.auth.viewmodel.AuthViewModel
import kotlinx.android.synthetic.main.activity_login.*

class LoginActivity : BaseActivity<AuthViewModel, ActivityLoginBinding>() {

    override val isUseBaseTitleBar: Boolean
        get() = true
    override val layoutId: Int
        get() = R.layout.activity_login

    override fun initView(savedInstanceState: Bundle?) {
        setTitle(getString(R.string.login))
    }

    override fun eventHandling() {
        super.eventHandling()
        btnPhoneLogin.setOnClickListener { PhoneLoginActivity.openActivity(mContext) }
        btnEmailLogin.setOnClickListener { EmailLoginActivity.openActivity(mContext) }
        btnRegister.setOnClickListener { RegisterActivity.openActivity(mContext) }
    }

    companion object {
        fun openActivity(mContext: BaseActivity<*, *>) {
            mContext.startActivity(null, LoginActivity::class.java)
        }
    }
}
